import { createApp } from 'vue';
import i18n from '@/i18n';
import App from './App.vue';
import './registerServiceWorker';
import router from './router';
import store, { key } from './store';
import globalComponent from './plugins/globalComponent';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import directive from './directive';

import 'element-plus/dist/index.css';
import '@/assets/css/index.scss';

import './permission';

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}
directive(app);
app.use(store, key);
app.use(router);
app.use(i18n);
app.use(globalComponent);
app.mount('#app');
